<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;



//Route::group('aa', function () {
//    Route::rule(':id', 'Blog/read1');
//    Route::rule(':name', 'Blog/read2');
//})->pattern(['id' => '\d+', 'name' => '\w+']);

//Route::rule('web', 'im.:Chat/home')->allowCrossDomain([
//    'Access-Control-Allow-Origin'        => 'thinkphp.cn',
//    'Access-Control-Allow-Credentials'   => 'true',
//    'Access-Control-Max-Age'             => 600,
//    'Access-Control-Expose-Headers'             => '*',
//]);;
Route::rule('test', 'im.Index/test');
Route::rule('web', 'im.Chat/home');
Route::rule('start', 'im.Chat/start');
Route::rule('widget/match', 'Widget/match');
Route::rule('wechat', 'im.Chat/wechat');
Route::rule('m', 'im.Chat/home')->append(['view' => 'mobile']);;
Route::rule('wait', 'im.Chat/wait');
Route::rule('switch', 'im.Chat/switch');
Route::rule('init', 'im.Chat/init')->allowCrossDomain([
    'Access-Control-Allow-Origin' => '*',
    'Access-Control-Allow-Credentials' => 'true',
    'Access-Control-Max-Age' => 600,
    'Access-Control-Expose-Headers' => '*',
]);;
Route::rule('message', 'im.Chat/message');
Route::rule('im/error/[:code]', 'im.Foreign/wrong');
//	Route::rule('api/v2/:controller/:action', 'api.v2.:controller/:action')->allowCrossDomain()
//        ->middleware([\app\common\middleware\AllowOriginMiddleware::class]);;